﻿@{
    Layout = null;
}
@model System.Collections.IEnumerable
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title></title>
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

        @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
    )
        @Html.DevExpress().GetScripts(
            new Script { ExtensionType = ExtensionType.ListBox }
    )

    <script>
        function nodeClick(s, e) {
            parent.$("#contentframe").attr("src", e.node.name);
            
        }


        function refreshNodeName(nodeName) {
            var node = LeftTreeView.GetSelectedNode();
            node.SetText(nodeName);
        }
     
    </script>

</head>
<body>
    <div>
        @Html.DevExpress().TreeView(settings =>
{
    settings.Name = "LeftTreeView";
    settings.ShowTreeLines = true;
    settings.AllowSelectNode = true;
    settings.NameField = "Id";
    settings.TextField = "Name";
    settings.ImageUrlField = "ImageUrl";
    settings.ClientSideEvents.NodeClick = "function(s, e) { nodeClick(s,e) }";
    settings.PreRender = (source, e) =>
    {
        ASPxTreeView treeView = (ASPxTreeView)source;
        treeView.ExpandAll();
        if (treeView.Nodes.Count>0)
        {
            treeView.SelectedNode = treeView.Nodes[0];
        }
    };

}).Bind(Model).GetHtml()
    </div>

    <script type="text/javascript" language="javascript">
        lp.Hide();
    </script>

</body>
</html>
